import random

luckTicket = random.sample(range(1,33),8)
first,second,third,fourth,sorry = 0,0,0,0,0


for i in range(1000):
    myTicket = random.sample(range(1,33),8)

    if len(list(set(luckTicket).intersection(set(myTicket))))==5:
        fourth = fourth + 1

    elif len(list(set(luckTicket).intersection(set(myTicket))))==6:
        third = third + 1

    elif len(list(set(luckTicket).intersection(set(myTicket))))==7:
        second = second + 1

    elif len(list(set(luckTicket).intersection(set(myTicket))))==8:
        first = first + 1

    else:
        sorry = sorry+1
print("一等奖:{}次".format(first))
print("二等奖:{}次".format(second))
print("三等奖:{}次".format(third))
print("四等奖:{}次".format(fourth))
print("未中奖:{}次".format(sorry))
